package com.stdio.view;

import com.stdio.R;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ContactDetailView extends LinearLayout {
	
	private LinearLayout layout_phoneview;
	private LinearLayout layout_emailview;
	private TextView mTitleText;
	private TextView mContentText;
	private Context ctx;
	
	public ContactDetailView(Context context) {
		super(context,null);
		// TODO Auto-generated constructor stub
	}
	
	public ContactDetailView(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
		this.ctx = context;
		//mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		LayoutInflater.from(context).inflate(R.layout.list_item_contact_detail1, this, true);
	}

	public void setDetailInfo(String title,String content)
	{
		if(ctx.getResources().getString(R.string.contact_details_title_phone).equals(title))
		{
			layout_emailview = (LinearLayout)findViewById(R.id.content_layout2);
			this.removeView(layout_emailview);
			layout_emailview.setVisibility(View.GONE);
			mTitleText = (TextView)findViewById(R.id.action1);
			mContentText = (TextView)findViewById(R.id.item_value1);
			mTitleText.setText(title);
			mContentText.setText(content);
		}
		else if(ctx.getResources().getString(R.string.contact_details_title_email).equals(title))
		{
			layout_phoneview = (LinearLayout)findViewById(R.id.content_layout1);
			this.removeView(layout_phoneview);
			layout_phoneview.setVisibility(View.GONE);
			mTitleText = (TextView)findViewById(R.id.item_value3);
			mContentText = (TextView)findViewById(R.id.item_value4);
			mTitleText.setText(title);
			mContentText.setText(content);
		}
	}
	
	
}
